// 引入axios
import http from '@/utils/axios'
export interface IGoodsInfo {
  id?: string
  goodsName: string
  goodsPicture: string
  type: number
  childType: string
  phoneNum: string
  price: number
  description: string
  number: number
}
export interface IGoodsListQuery {
  pageSize: number,
  pageNum: number
  goodsName: string
  price: number | null
}
export const GET_GOODS_LIST = (params: IGoodsListQuery) => {
  return http({
    url: '/getGoods',
    params,
    method: 'get'
  })
}
export const SAVE_GOODS = (params: IGoodsInfo) => {
  return http({
    url: '/saveGoods',
    data: params,
    method: 'POST'
  })
}
export const DELETE_GOODS = (id: string) => {
  return http({
    url: '/deleteGood',
    method: 'GET',
    params: {id}
  })
}
export const GET_DETAIL = (id: string) => {
  return http({
    url: '/getDetail',
    method: "POST",
    data: {id}
  })
}